package cn.edu.scau.cmi.ema.service.base;

import org.springframework.stereotype.Component;

import java.beans.PropertyEditorSupport;
import java.util.HashSet;
import java.util.Set;

@Component

public class CmiDeleteEntitysIdEditor extends PropertyEditorSupport{

	@Override 
	public  void setAsText(String  str) {
		Set<Integer>  deleteEntitysId = new HashSet<>();
		if(str.length() > 0) {
			String[]  listString = str.split(",");
			for(String currentString: listString) {
				deleteEntitysId.add(Integer.parseInt(currentString.trim()));
			}
		}
		this.setValue(deleteEntitysId);
	}
}
